var CON_SEX = ['女', '男'];
var CON_ROLE = ['超级管理员', '管理员', '用户'];



$(function () {
    //角色数字到字符串的转化
    $(".roleNeedConvert").each(function () {
        var num = $(this).text();
        $(this).text(CON_ROLE[num]);
    })

    $(".timeNeedConvert").each(function () {
        var num = $(this).text();
        $(this).text(timeFormat(num));
    })

})



function add0(m){return m<10?'0'+m:m }
//时间戳转化成时间格式
function timeFormat(timestamp){
    timestamp = parseInt(timestamp);
    var time = new Date(timestamp);
    var year = time.getFullYear();
    var month = time.getMonth()+1;
    var date = time.getDate();
    var hours = time.getHours();
    var minutes = time.getMinutes();
    var seconds = time.getSeconds();
    return year+'-'+add0(month)+'-'+add0(date)+' '+add0(hours)+':'+add0(minutes)+':'+add0(seconds);
}
